package chpt04.shapes;


public class Test {

	public static void main(String[] args) {
		Shape[] shapes = new Shape[2];
		shapes[0] = new Circle(10);
		shapes[1] = new Rectangle(10,10);
		for (Shape e : shapes) {
			if (e instanceof Circle) {
				Circle c = (Circle)e;
				System.out.println(c.getArea());
			}
		}
		
		Object[] arr = new Object[3];
		arr[0] = new Integer("12");
		arr[1] = "Str";
		arr[2] = new Circle(10);
		for (Object e : arr) {
			if (e instanceof Shape) {
				System.out.println(e+ " is a Shape");
			}
		}
				
	}

}
